/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 19182
 * Date: 2025-07-20
 * Time: 19:11
 */
public class Student implements Comparable<Student>, Cloneable{
    public String name;
    public int age;
    public Money money;

    public Student(String name, int age, int money) {
        this.name = name;
        this.age = age;
        this.money = new Money(money);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", money=" + money.money + '}';
    }

    @Override
    public int compareTo(Student o) {
        return this.age - o.age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Student tmp = (Student)super.clone();
        tmp.money = (Money)this.money.clone();
        return tmp;
    }
}
